﻿namespace FluentDataContract.Adapters.Json.Tests
{
    using System;
    using FluentDataContract.Tests;
    using NUnit.Framework;
    using Newtonsoft.Json;

    [TestFixture]
    public class Tests
    {
        [Test]
        public void CanSerialize()
        {
            var obj = new Apple
            {
                    Colour = "Red", 
                    Expiry = DateTime.Now, 
                    SomethingNullable = null
            };

            var contractResolver = new FluentContractResolver();
            
            var jsonSettings = new JsonSerializerSettings {ContractResolver = contractResolver};
            var json = JsonConvert.SerializeObject(obj, jsonSettings);

            Assert.NotNull(json);
        }
    }
}